import { Loading } from 'element-ui';

let loading = undefined;

//开启加载

export const open_loading = (msg) => {
    loading = Loading.service({
        lock: true,
        text: msg || '请稍后...',
        spinner: 'el-icon-loading',
        background: 'rgba(0, 0, 0, 0.3)'
    });
}

//关闭加载
export const close_loading = () => {
    if (loading)
        loading.close();6
}